package com.hui.service;

import com.hui.dao.mapper.UserMapper;
import com.hui.entity.User;
import com.hui.util.PasswordHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;


    public void save(User user) {
        User u = new PasswordHelper().encryptPassword(user);
        userMapper.insert(u);
    }

    public List<User> find(User bean) {
        return userMapper.find(bean);
    }
}
